package DBHelper;

/**
 * @description: action result
 * @author: XuYuanjun
 * @create: 2020-03-25 22:27
 **/
public class ActionResult<T> {
    private boolean success;

    private T obj;

    private String phrase;
    
    /**
     * 是否成功
     */
    public boolean getSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }


    /**
     * 结果
     */
    public T getObj() {
        return obj;
    }

    public void setObj(T obj) {
        this.obj = obj;
    }

    /**
     * 结果信息
     */
    public String getPharse() {
        return phrase;
    }

    public void setPhrase(String phrase) {
        this.phrase = phrase;
    }

    protected ActionResult() { }

    public ActionResult(boolean success, String phrase, T obj) {
        setSuccess(success);
        setPhrase(phrase);
        setObj(obj);
    }

    public ActionResult(boolean success){
        setSuccess(success);
        setPhrase(new String());
        setObj(null);
    }

    public ActionResult(boolean success,String phrase){
        setSuccess(success);
        setPhrase(phrase);
        setObj(null);
    }
}

